package cn.tedu.boot041.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {
    @RequestMapping("/bmi")
    public String nmi(double height,double weight){
        Double num = weight/(height*height);
        if (num<18.5){
            return "您的指标为:"+num+"偏瘦";
        }else if (num<24){
            return "您的指标为:"+num+"健康";
        }else if (num<28){
            return "您的指标为:"+num+"微胖";
        }else {
            return "您的指标为:"+num+"很胖";
        }
    }
}
